// 文档注释
/**
 * 防抖函数
 * @author Shuster_Li <15576730892@163.com>
 * @param {Function} func
 * @param {Number} wait
 */

const debounce = (func, wait = 1000) => {
    let timeout;
    return (...args) => {
        clearTimeout(timeout);
        timeout = setTimeout(() => {
            func(...args);
        }, wait);
    };
};

export default debounce;